package com.vortex.cloud.sample.domain;

import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import lombok.Data;
import org.hibernate.annotations.Table;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import java.util.Date;

/**
 * @author 王林
 * @version 1.0
 * @date 2021-10-15 周五
 * @time 14:02
 * @description
 */
@Data
@Entity(name = TaskUserInfo.TABLE_NAME)
@Table(appliesTo = TaskUserInfo.TABLE_NAME, comment = "task_user_info表")
@TableName(value = TaskUserInfo.TABLE_NAME)
public class TaskUserInfo extends Model {
    public static final String TABLE_NAME = "task_user_info";

    /**
     * 物理id
     */
    @Id
    @Column(columnDefinition = "int(10) comment 'ID'")
    @ExcelProperty(value = "ID")
    private String id;

    @Column(columnDefinition = "varchar(20) comment '用户ID'")
    @ColumnWidth(20)
    @ExcelProperty(value = "用户ID")
    private String userId;

    @Column(columnDefinition = "varchar(20) comment '用户名'")
    @ExcelProperty(value = "用户名")
    private String name;

    @Column(columnDefinition = "varchar(20) comment '邮箱'")
    @ColumnWidth(15)
    @ExcelProperty(value = "邮箱")
    private String email;

    @Column(columnDefinition = "char(2) comment '性别'")
    @ExcelProperty(value = "性别")
    private String gender;

    @Column(columnDefinition = "int(10) comment '积分'")
    @ExcelProperty(value = "积分")
    private Integer score;

    @Column(columnDefinition = "varchar(20) comment 'IP'")
    @ColumnWidth(20)
    @ExcelProperty(value = "IP")
    private String ip;

    @Column(columnDefinition = "int(10) comment '登入次数'")
    @ColumnWidth(15)
    @ExcelProperty(value = "登入次数")
    private Integer count;

    @Column(columnDefinition = "date comment '加入时间'")
    @ColumnWidth(20)
    @ExcelProperty(value = "加入时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date startDate;
}
